package com.wlyuan.open.scanner.utils.enums;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 有效状态对应关系
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum SourceInvalidEnum implements NamedValue<Integer> {

    //状态启用
    INVALID_YES(0, 1, "启用"),
    //状态禁用
    INVALID_NO(1, 0, "禁用");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, SourceInvalidEnum> MAP = new NamedValueMap<>(SourceInvalidEnum.class);

    public static SourceInvalidEnum fromValue(Integer value) {
        return MAP.get(value);
    }

}
